<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>

<%@page import="java.sql.SQLException"%>
<%@page import="java.io.IOException"%>
<%@page import="java.io.PrintWriter"%>
<%@page import="javax.servlet.annotation.WebServlet"%>
<%@page import="javax.servlet.http.HttpServlet"%>
<%@page import="javax.servlet.http.HttpServletRequest"%>
<%@page import="javax.servlet.http.HttpServletResponse"%>
<%@page import="javax.servlet.http.HttpSession"%>
<%@page import="com.Dao.ProcDao"%>
<%@page import="com.Dao.UserDao"%>
<%@page import="com.pojo.User"%>
<%@page import="com.google.gson.Gson"%>
<%@page import="com.pojo.Sight"%>
<%
request.setCharacterEncoding("utf-8");	
response.setCharacterEncoding("utf-8");
String theme = request.getParameter("theme");
String contant = request.getParameter("contant");
String title = request.getParameter("title");
Integer UId= Integer.valueOf(request.getParameter("uid"));
ProcDao ProcDao =new ProcDao();
Integer count = null;
	try {
		count = ProcDao.savetheme(theme);
		ProcDao.savex(UId, title, count, contant);
		System.out.println(theme);
		
		
		
	} catch (SQLException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	session.removeAttribute("user");
	String up = ((User)session.getAttribute("user")).getUphone();
	UserDao userDao = new UserDao();
	User result = userDao.findUserByUsery(up);
	session.setAttribute("user",result);
Gson gson = new Gson();
String jsonStr = gson.toJson(result);
PrintWriter outx = response.getWriter();
outx.print(jsonStr);
%>
